home *** CD-ROM | disk | FTP | other *** search
/ Netware Super Library / Netware Super Library.iso / pegamail / pdpmpop / pm-menu.r < prev    next >
Text File  |  1994-01-23  |  9KB  |  201 lines

  1. ##
  2. ##  PM-Menu.r
  3. ##  Extensions to the Pegasus Mail Main Menu, for PMail 3.0
  4. ##  Copright (c) 1993, David Harris, All Rights Reserved.
  5. ##
  6. ##  This resource-based scheme replaces the SENDER.PM file
  7. ##  found in PMail 2.35 and earlier. While the format of the
  8. ##  new scheme is slightly more complex than the old method,
  9. ##  it is more in keeping with the resource basis of PMail
  10. ##  v3.0 and can potentially do considerably more at the 
  11. ##  cost of less memory.
  12. ##
  13. ##  The first three items in the resource file MUST be popup
  14. ##  menus - the first for additions to the "New Mail" option
  15. ##  on the main menu, the second for additions to the "Send
  16. ##  a message" option and the third for any site-specific
  17. ##  directory lookup services. It may be possible in future
  18. ##  to add other options to the main menu as well.
  19. ##
  20. ##  The "return" field of each option in the popup menu should
  21. ##  be a resource number in this file describing the action
  22. ##  which should be taken.
  23. ##
  24. ##  To create submenus for PMail v3.0, make any changes necessary
  25. ##  to this file, then compile it using the Pegasus Mail Resource
  26. ##  Compiler, ResCom, using the command "rescom pm-menu.r". The
  27. ##  result will be a file called PM-MENU.RSC - you can either copy
  28. ##  this file into the same directory as PMAIL.EXE if you want it
  29. ##  to be available to all users on your network, or into your home
  30. ##  mailbox if you want it to apply only to you.
  31. ##
  32. ##  To disable one of the menus while retaining the other, set
  33. ##  the first integer in the popup menu definition for the menu
  34. ##  you do NOT want to 0.
  35. ##
  36.  
  37. include defines.rh
  38.  
  39. ##  ┌──────────────────────────────────────────────────────┐
  40. ##  │ The following declaration creates the necessary type │
  41. ##  │ information for ResCom, the PMail resource compiler. │
  42. ##  │ It must NEVER be changed.                            │
  43. ##  └──────────────────────────────────────────────────────┘
  44.  
  45. typedef popup_menu 51
  46.    {
  47.    integer,    #  Resource ID of menu numbering from 0 in the file
  48.    integer,    #  X-coordinate of the TLC of the menu on the screen
  49.    integer,    #  Y-coordinate of the TLC of the menu on the screen
  50.    integer     #  Attribute word for the popup menu (colours etc)
  51.    string 30   #  Window title for popup menu
  52.    };
  53.  
  54. typedef menu_option 90
  55.    {
  56.    char,       #  Non-zero to save and clear the screen before running
  57.    char,       #  Non-zero if the temporary file should be mailed on return
  58.    char,       #  Non-zero to enter the newmail screen after invoking
  59.    char,       #  Non-zero if the command is actually a form filename
  60.    string 100  #  The command line, formatted for substitution
  61.    };
  62.  
  63.  
  64. ##  ┌──────────────────────────────────────────────────────┐
  65. ##  │ The first three entries in the resource (0,1,2) must │
  66. ##  │ describe the popup menu for new mail additions, send │
  67. ##  │ mail additions and directory services respectively.  │
  68. ##  └──────────────────────────────────────────────────────┘
  69.  
  70. popup_menu new_mail        # Resource 0 - New mail submenu
  71.    {
  72.    3,                      #  Set to 0 if you do not want a new mail submenu
  73.    29, 8,                  #  X and Y co-ordinates of TLC of popup menu
  74.    BLIGHTGREY | RED | wshadow,
  75.    " New mail options "
  76.    };
  77.  
  78. popup_menu send_mail       # Resource 1 - Send mail submenu
  79.    {
  80.    4,                      #  Set to 0 if you do not want a send mail submenu
  81.    29, 10,                 #  X and Y co-ordinates of TLC of popup menu
  82.    BLIGHTGREY | RED | wshadow,
  83.    " Send mail options "
  84.    };
  85.  
  86. popup_menu addresses       # Resource 2 - Directory service interface
  87.    {
  88.    0,                      #  Set to 0 if no address lookup services are present
  89.    5, 2,                   #  X and Y co-ordinates of TLC of popup menu
  90.    BLIGHTGREY | RED | wshadow,
  91.    " Local directory service "
  92.    };
  93.  
  94.  
  95. ##  ┌──────────────────────────────────────────────────────────────┐
  96. ##  │ The menu agglomerated data type consists of a header         │
  97. ##  │ followed by an array of menu records. The header has         │
  98. ##  │ up to five integer values:                                   │
  99. ##  │                                                              │
  100. ##  │    1:  Number of items in this menu                          │
  101. ##  │    2:  The menu mode (any M* constants in defines.rh ORed)   │
  102. ##  │    3:  The default choice in the menu (starting from 0)      │
  103. ##  │    4:  The colour of an unhighlighted entry                  │
  104. ##  │    5:  The colour of a highlighted entry                     │
  105. ##  │                                                              │
  106. ##  │ All the header values except 1 are sensibly defaulted        │
  107. ##  │                                                              │
  108. ##  │ A menu record describes on entry in the menu: it is built    │
  109. ##  │ as follows:                                                  │
  110. ##  │                                                              │
  111. ##  │    1:  (Integer)  The X (horizontal) position of the item    │
  112. ##  │    2:  (Integer)  The Y (vertical) position of the item      │
  113. ##  │    3:  (Integer)  An optional help or ID value for the item  │
  114. ##  │    4:  (Char)     The character which selects this item      │
  115. ##  │    5:  (Integer)  The value to return if item is selected    │
  116. ##  │    6:  (String)   The text to display for the choice         │
  117. ##  │                                                              │
  118. ##  │ No item in a menu record is defaulted.                       │
  119. ##  └──────────────────────────────────────────────────────────────┘
  120.  
  121. menu new_mail_menu            ##  This is resource 3 in the file
  122.    {
  123.    2, 0, 0, BLUE | BLIGHTGREY, BBLUE | WHITE;
  124.  
  125.    1, 1, 0, 'N', 6, "Read Nn@ew mail",
  126.    1, 2, 0, 'G', 7, "NG@et new mail by POP3",
  127.    };
  128.  
  129. menu send_mail_menu           ##  This is resource 4 in the file
  130.    {
  131.    3, 0, 0, BLUE | BLIGHTGREY, BBLUE | WHITE;
  132.  
  133.    1, 1, 0, 'C', 8,  "NC@ompose a new message",
  134.    1, 2, 0, 'D', 33, "Reopen a Nd@raft message",
  135.    1, 3, 0, 'S', 9,  "NS@end all messages",
  136.    };
  137.  
  138. menu address_menu             ##  This is resource 5 in the file
  139.    {
  140.    0, 0, 0, BLUE | BLIGHTGREY, BBLUE | WHITE;
  141.  
  142.    1, 1, 0, 'C', 8,  "NC@ompose a new message",
  143.    };
  144.  
  145.  
  146. ##  ┌──────────────────────────────────────────────────────────────────────┐
  147. ##  │ And now we have the actual resources describing the actions which    │
  148. ##  │ should occur when a particular item is selected from a menu.         │
  149. ##  │                                                                      │
  150. ##  │ The following definitions are intended as samples for you to use.    │
  151. ##  │ Note that you have to double any '\' characters you use in file      │
  152. ##  │ names or command strings because the resource compiler views a       │
  153. ##  │ single '\' as an escape character.                                   │
  154. ##  │                                                                      │
  155. ##  │ The command to run for an option can include most of the command     │
  156. ##  │ substitutions defined in the User-defined gateway guide (UDG.TXT)    │
  157. ##  │ contained in this release of PMail in the file UDG.ZIP. The command  │
  158. ##  │ substitution you will use most often is "~c", which is replaced by   │
  159. ##  │ the name of the temporary file PMail creates containing the data     │
  160. ##  │ from the message.                                                    │
  161. ##  └──────────────────────────────────────────────────────────────────────┘
  162.  
  163. menu_option read_new_1        ##  This is resource 6 in the file
  164.    {
  165.    0,                   ##  Don't bother saving the screen before invoking
  166.    0,                   ##  Do not mail the temporary file on return
  167.    0,                   ##  Enter the newmail screen once this command returns
  168.    0,                   ##  No, this entry is not a form
  169.    ""                   ##  Empty string invokes the standard action (read new mail)
  170.    };
  171.  
  172. menu_option read_new_2        ##  This is resource 7 in the file
  173.    {
  174.    0,                   ##  Don't bother saving the screen before invoking
  175.    0,                   ##  Do not mail the temporary file on return
  176.    1,                   ##  Enter the newmail screen once this command returns
  177.    0,                   ##  No, this entry is not a form
  178.    "pmpop -3~w -v2 -g > nul" 
  179.                         ##  Invoke the PMPOP gateway to retrieve new mail
  180.    };
  181.  
  182. menu_option send_1            ##  This is resource 8 in the file
  183.    {
  184.    0,                   ##  Don't bother saving the screen before invoking
  185.    0,                   ##  Do not mail the temporary file on return
  186.    0,                   ##  Don't Enter the send message screen on return
  187.    0,                   ##  No, this entry is not a form
  188.    ""                   ##  Empty string invokes the standard action (send message)
  189.    };
  190.  
  191. menu_option send_2            ##  This is resource 9 in the file
  192.    {
  193.    0,                   ##  Don't bother saving the screen before invoking
  194.    0,                   ##  Do not mail the temporary file on return
  195.    0,                   ##  Don't Enter the send message screen on return
  196.    0,                   ##  No, this entry is not a form
  197.    "pmpop -4~h\\*.msg -N\"~p\" -s > nul"
  198.                         ##  Invoke the PMPOP gateway to send waiting mail
  199.    };
  200.  
  201.